package qst.com.bacK.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import qst.com.bacK.pojo.entity.ExamQuestion;

import java.sql.SQLException;

/**
 * Author:   msh
 * Date:     2024/10/11 上午9:24
 * Description:
 */
public interface ExamQuestionMapper {
    @Delete("delete from exam_questions where exam_id = #{id}")
    void deleteByExam(Integer id)throws SQLException;

    @Insert("insert into exam_questions(exam_id, question_id,personnel_id, score, answer, result) " +
            "values(#{eq.examId}, #{questionId},#{testPersonnelId}, #{score}, #{answer}, #{isRight})")
    void save(ExamQuestion eq, @Param("answer")String answer)throws SQLException;
}
